﻿using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Web;
using Systen.Wechat.Pay;

namespace WxPayAPI
{
    /**
    * 	配置账号信息
    */
    public class WxPayConfig
    { 
        //=======【基本信息设置】=====================================
        /* 微信公众号信息配置
        * APPID：绑定支付的APPID（必须配置）
        * MCHID：商户号（必须配置）
        * KEY：商户支付密钥，参考开户邮件设置（必须配置）
        * APPSECRET：公众帐号secert（仅JSAPI支付的时候需要配置）
        */
        //public const string APPID = "wx3495083a971f3614";
        private static string _appId = "";
        public static string APPID
        {
            get
            {
                if (string.IsNullOrEmpty(_appId))
                {
                    _appId= "wxbb8230744c4a85a7";
                }
                return _appId;
            }
        }

        private static string _macht = "";

        public static string MCHID
        {
            get
            {
                if (string.IsNullOrEmpty(_macht))
                {
                    _macht = "1619175264";
                }
                return _macht;
            }
        }
        private static string _key = "";

        public static string KEY
        {
            get
            {
                if (string.IsNullOrEmpty(_key))
                {
                    _key = "IpboT0837wspWUl0ehIF6DL3vQkwK1bZ";
                }
                return _key;
            }
        }

        public static string _Privatekey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCuaojL0cu3mbExuLzY/2yQcgVr16w//FT+Rn2VFWTUpMXo+Kn7wu2oRUZvRs1LXK6F/6BbnkH0LCAPQwFuif7AxDxv9yrKIJXRHOcwIeHOf/xWvXiBOT3ApbxKh5cYNwpdx3Drw4m5IS088GEAVwPIPdChyRPOldgQOmLJK6u2+82zc72nQVStLKW1qS54PNw8fA9tYnJY/0duoirWshjF0GSjv80lyv7ZEfT0CM5duRGd0JoFBa0FE6I+v8fy2eR+z1NsRkANK3kele3qeB5/DGjoQKQZbLC1nkv2Q8QXHFBMQCCUI9TkTSppMnTb3AfZRQnWrBHVUPZE6H1UCDRvAgMBAAECggEAS/fJB4Wkhp6hqDd/wcBXB/8xz0wMEX6Vgn8vebzswxXVweh1GVxI6W7rA9LB3l5LAcBaly0yKukBOcSEniHq3QlcDaSJdaq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T5v1G7JXAYvi/GtwABRoYMjDdBX97nsPRs+tj";

        //public const string APPSECRET = "51c56b886b5be869567dd389b3e5d1d6";

        //=======【证书路径设置】===================================== 
        /* 证书路径,注意应该填写绝对路径（仅退款、撤销订单时需要）
        */
        private static string _sslcertPath = "";

        public static string SSLCERT_PATH
        {
            get
            {
                if (string.IsNullOrEmpty(_sslcertPath))
                {
                    _sslcertPath = System.IO.Directory.GetCurrentDirectory() + "\\cert\\";
                }
                return _sslcertPath;
            }
        }
        private static string _sslcertPassword = "";
        public static string SSLCERT_PASSWORD
        {
            get
            {
                if (string.IsNullOrEmpty(_sslcertPassword))
                {
                    _sslcertPassword = "";
                }
                return _sslcertPassword;
            }
        }



        //=======【支付结果通知url】===================================== 
        /* 支付结果通知回调url，用于商户接收支付结果
        */
        private static string _notifyUrl = "https://daimao.cqbaidu.com/api/v1/Wechat/PaymentCallback";
        public static string NOTIFY_URL
        {
            get
            {
                if (string.IsNullOrEmpty(_notifyUrl))
                {
                    _notifyUrl = "";
                }
                return _notifyUrl;
            }
        }

        private static string _notifyReturnUrl = "";
        public static string NOTIFY_RETRUN_URL
        {
            get
            {
                if (string.IsNullOrEmpty(_notifyReturnUrl))
                {
                    _notifyReturnUrl = "";
                }
                return _notifyReturnUrl;
            }
        }

        //=======【商户系统后台机器IP】===================================== 
        /* 此参数可手动配置也可在程序中自动获取
        */
        public const string IP = "8.8.8.8";


        //=======【代理服务器设置】===================================
        /* 默认IP和端口号分别为0.0.0.0和0，此时不开启代理（如有需要才设置）
        */
        public const string PROXY_URL = "http://10.152.18.220:8080";

        //=======【上报信息配置】===================================
        /* 测速上报等级，0.关闭上报; 1.仅错误时上报; 2.全量上报
        */
        public const int REPORT_LEVENL = 1;

        //=======【日志级别】===================================
        /* 日志等级，0.不输出日志；1.只输出错误信息; 2.输出错误和正常信息; 3.输出错误信息、正常信息和调试信息
        */
        public const int LOG_LEVENL = 3;
    }
}